<template>
	<view class="bg-gradual-blue">
		<stop bgColor=""  :top="myScrollTop" :changed.sync="myRnd" bgColorFixed="bg-white" startColor="white">
			<block slot="content">用户中心</block>
		</stop>
		<view class="flrc padl10 padr10 pos-r">
			<view class="flrc mart3" v-if="$com.isTrue(login)">
				<view>
					<image src="../../static/default.png" mode="aspectFill" class="wh20-20 round bdso bdcf bdw5" v-if="!$com.isTrue(user)"></image>
					<image :src="pic(user.pic)" mode="aspectFill" class="wh20-20 round bdso bdcf bdw5" v-if="$com.isTrue(user)"></image>
				</view>
			</view>
			<view class="flex1 padl3 pos-r padtb3"  @tap="goto('/pages/common/user/user_info')">
				<view class="mart2 fwb fs10" style="" v-if="$com.isTrue(login)">
					<text>
						你好，{{$com.isTrue(user)?user.name:'注册用户'}}！
					</text>
					<text class="" @click="$win.goto('/pages/wuliu/phone/phone')" v-if="$com.isTrue(login)">
						 {{$com.isTrue(user)?$com.isTrue(user.phone)?user.phone:'点击绑定手机号':'点击绑定手机号'}} 
					</text>
				</view>
				
				<view class="flex-r flex-start fs8 mart3">
					<view class="line-white cu-btn sm round1 marr1" v-for="job in user.jobs">{{job.name}}</view>
					<view class="line-white cu-btn sm round1 marr1" v-show="user.jobs == 0">岗位未定</view>
				</view>
				<view class="text-xxl tac pad5 ripple" v-if="!$com.isTrue(login)">
					未登录
				</view>
				<ripple></ripple>
			</view>
			<view class="pos-a r9 t9 fs16">
				<view @tap="goto('/pages/common/settings/settings')" class=" pos-r round wh10-10 ofh flcc bca003"><view class="fa fa-cog"></view> <ripple></ripple></view>
			</view>
		</view>
		<view class="bg-white padt3 fs14 mart5">
			<!-- <view class="flrc pad3 mar2 pos-r bdso round3 bc13" @click="$win.goto('/pages/machine/break_order_my')">
				<view class="wh10-10 bc02 flcc round cf">
					<text class="fa fa-cube"></text>
				</view>
				<view class="flex1 padl5">
					<view>我的报修</view>
					<text class="fs10">报修、查看、确认、反馈</text>
					</view>
				<view class=""><text class="fa fa-angle-right"></text></view>
				<ripple></ripple>
			</view>
			<view class="flrc pad3 mar2 pos-r bdso round3 bc13" @click="goto('/pages/machine/fix_order_my')">
				<view class="wh10-10 bc03 flcc round cf">
					<text class="fa fa-cube"></text>
				</view>
				<view class="flex1 padl5">
					<view>我的维修任务</view>
					<text class="fs10 c12">查看、维修、移交、取消</text>
				</view>
				<view class=""><text class="fa fa-angle-right"></text></view>
				<ripple></ripple>
			</view> -->
			<view class="flrc pad3 mar2 pos-r" @click="goto('/pages/common/message/bin_wechat')">
				<view class="wh10-10 bc05 flcc round cf">
					<text class="fa fa-cube"></text>
				</view>
				<view class="flex1 padl5">
					<view>绑定微信</view>
					<text class="fs10 c12">APP站内消息将推送至微信</text>
				</view>
				<view class=""><text class="fa fa-angle-right"></text></view>
				<ripple></ripple>
			</view>
			<view class="flrc pad3 mar2 pos-r" @click="goto('/pages/common/page/page?code=QUESTIONS')">
				<view class="wh10-10 bc05 flcc round cf">
					<text class="fa fa-cube"></text>
				</view>
				<view class="flex1 padl5">
					<view>Q&A</view>
					<text class="fs10 c12">常见问题和操作指南</text>
				</view>
				<view class=""><text class="fa fa-angle-right"></text></view>
				<ripple></ripple>
			</view>
			<view class="flrc pad3 mar2 pos-r" @click="goto('/pages/common/page/page?code=ABOUT')">
				<view class="wh10-10 bc06 flcc round cf">
					<text class="fa fa-cube"></text>
				</view>
				<view class="flex1 padl5">
					<view>关于我们</view>
					<text class="fs10 c12">联系方式、商务合作</text>
				</view>
				<view class=""><text class="fa fa-angle-right"></text></view>
				<ripple></ripple>
			</view>
			<view class="flrc pad3 mar2 pos-r" @click="$win.goto('/pages/user/phoneLogin')" data-code="ABOUT">
				<view class="wh10-10 bc07 flcc round cf">
					<text class="fa fa-share-square"></text>
				</view>
				<view class="flex1 padl5">
					<view>切换账号</view>
					<!-- <text class="fs10 c12"></text> -->
				</view>
				<view class=""><text class="fa fa-angle-right"></text></view>
				<ripple></ripple>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				login: false,
				user: {},
				wuser: {},
				vip: 0,
				data:{
					order:0,
					sons:0,
					money:0
				}
			}
		},
		methods: {
		},
		onLoad() {
			
		},
		onShow() {
			let _this = this
			this.login = this.$com.isLogin()
			this.$api.get('/api/ciming/get_user_info',{
				_g:["user","job"]
			},(res)=>{
				this.log(res)
				_this.login = res.d.login
				_this.user = res.d.wuser
				_this.wuser = res.d.wuser
				_this.vip = res.d.vip
			})
		}
	}
</script>

<style>

</style>
